# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: pressh <pressh@gmail.com>

pkgname=alacarte
pkgver=3.44.2
pkgrel=2
epoch=1
pkgdesc="Menu editor for gnome"
url="https://gitlab.gnome.org/GNOME/alacarte"
arch=(any)
license=(LGPL)
depends=(gnome-menus python-gobject python-cairo gtk3)
makedepends=(libxslt docbook-xsl git)
_commit=d17e9b08324a9958f734c0756e6d185c16135f55  # tags/3.44.2^0
source=("git+https://gitlab.gnome.org/GNOME/alacarte.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd alacarte
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd alacarte
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd alacarte
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
  make
}

package() {
  cd alacarte
  make DESTDIR="$pkgdir" install

  python -m compileall -d /usr "$pkgdir/usr"
  python -O -m compileall -d /usr "$pkgdir/usr"
}
